package com.learn.bus.member;

import com.learn.bus.Data;
import com.learn.bus.Member;
import com.learn.bus.data.StatusData;
import lombok.extern.slf4j.Slf4j;

/**
 * <p>项目名称: design-pattern </p>
 *
 * <p>文件名称: StatusMember </p>
 *
 * Receiver of Data-Bus events.
 */
@Slf4j
public class StatusMember implements Member {

    @Override
    public void accept(Data data) {
        if(data instanceof StatusData){
            log.info(String.format("%s sees message %s", ((StatusData) data).getWhen(), ((StatusData) data).getDetail()));
        }
    }
}
